@echo off
echo ========================================
echo 话单查询系统 - 打包脚本
echo ========================================
echo.

REM 设置版本号
set VERSION=1.0.0
set PACKAGE_NAME=VOS话单查询系统_v%VERSION%

echo 正在打包版本 %VERSION%...
echo.

REM 创建临时目录
if exist "%PACKAGE_NAME%" rmdir /s /q "%PACKAGE_NAME%"
mkdir "%PACKAGE_NAME%"

REM 复制必要文件
echo 复制文件...
copy "import paramiko.py" "%PACKAGE_NAME%\"
copy "requirements.txt" "%PACKAGE_NAME%\"
copy "README.md" "%PACKAGE_NAME%\"
copy "start.bat" "%PACKAGE_NAME%\"
copy "install.bat" "%PACKAGE_NAME%\"

REM 复制templates目录
xcopy "templates" "%PACKAGE_NAME%\templates\" /e /i /q

REM 复制Linux/Mac脚本
copy "start.sh" "%PACKAGE_NAME%\"
copy "install.sh" "%PACKAGE_NAME%\"

REM 创建zip文件
echo 创建压缩包...
powershell -command "Compress-Archive -Path '%PACKAGE_NAME%' -DestinationPath '%PACKAGE_NAME%.zip' -Force"

REM 清理临时目录
rmdir /s /q "%PACKAGE_NAME%"

echo.
echo ========================================
echo 打包完成！
echo ========================================
echo.
echo 生成文件：%PACKAGE_NAME%.zip
echo.
echo 包含文件：
echo - import paramiko.py (主程序)
echo - templates/index.html (Web界面)
echo - requirements.txt (依赖列表)
echo - README.md (使用说明)
echo - start.bat (Windows启动脚本)
echo - install.bat (Windows安装脚本)
echo - start.sh (Linux/Mac启动脚本)
echo - install.sh (Linux/Mac安装脚本)
echo.
pause 